<?php

include "conn.php";

$id = $_GET['id'];

function deleteBlog($id): bool
{
    global $mysql;
    global $id;

    $res = mysqli_query($mysql, "update tb_blog set del_flag = 1 where id_blog = '$id';");

    if ($res === true) {
        return $res;
    } else {
        echo mysqli_error($mysql);
        return false;
    }

}

if (deleteBlog($id)) {
    header('Refresh:2;url=manageBlog.php');
    echo '2秒后返回，删除成功！';
} else {
    exit();
}